﻿// Study0624.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 第六章 数组和指针 字符串

#include <iostream>
#include <string>
using namespace std;
inline void test(const char* title,bool value)
{
	cout << title << " returns " << (value ? "true" : "false") << endl;
}

int main()
{
	string s1 = "DEF";
	cout << "s1 is " << s1 << endl;

	string s2;
	cout << "输入一个字符串" << endl;
	cin >> s2;
	cout << s2 << "的长度为" << s2.size() << endl;

	test("s1<=\"ABC\"", s1 <= "ABC");
	test("\"DEF\"<=s1", "DEF" <= s1);

	s2 += s1;
	cout << "s2=s2+s1:" << s2 << endl;
	cout << "s2的长度为" << s2.length() << endl;

	return 0;

}


